function columns(vm) {
  const cols = [
    {
      title: '序号',
      dataIndex: 'rowIndex',
      width: 60,
      align: 'center',
      customRender: function (t, r, index) {
        return parseInt(index) + 1
      }
    },
    {
      title: '账套名称',
      align: 'center',
      dataIndex: 'accName',
      width: 300,
      key: 'accName',
      scopedSlots: { customRender: 'accName' }
    },
    {
      title: '核算单元名称',
      align: 'center',
      dataIndex: 'unitName',
      width: 300,
      key: 'unitName',
      scopedSlots: { customRender: 'unitName' }
    },
    {
      title: '科目编号',
      align: 'left',
      key: 'subjectCode',
      dataIndex: 'subjectCode',
      scopedSlots: { customRender: 'subjectCode' }
    },
    {
      title: '科目名称',
      align: 'left',
      key: 'subjectName',
      dataIndex: 'subjectName',
      scopedSlots: { customRender: 'subjectName' }
    },
    {
      title: '期初余额',
      align: 'center',
      children: [
        {
          title: '方向',
          align: 'center',
          key: 'beginDirection',
          dataIndex: 'beginDirection'
        },
        {
          title: '本位币',
          align: 'right',
          key: 'beginCurrency',
          dataIndex: 'beginCurrency'
        }
      ]
    },
    {
      title: '本期发生',
      align: 'center',
      children: [
        {
          title: '借方本币',
          align: 'right',
          key: 'currentDebit',
          dataIndex: 'currentDebit'
        },
        {
          title: '货方本币',
          align: 'right',
          key: 'currentCredi',
          dataIndex: 'currentCredi'
        }
      ]
    },
    {
      title: '本年累计',
      align: 'center',
      children: [
        {
          title: '借方本币',
          align: 'right',
          key: 'yearDebit',
          dataIndex: 'yearDebit'
        },
        {
          title: '货方本币',
          align: 'right',
          key: 'yearCredi',
          dataIndex: 'yearCredi'
        }
      ]
    },
    {
      title: '期末余额',
      align: 'center',
      children: [
        {
          title: '方向',
          align: 'center',
          key: 'closeDirection',
          dataIndex: 'closeDirection'
        },
        {
          title: '本位币',
          align: 'right',
          key: 'closeCurrency',
          dataIndex: 'closeCurrency'
        }
      ]
    },
    {
      title: '开累发生',
      align: 'center',
      children: [
        {
          title: '借方本币',
          align: 'right',
          key: 'totalDebit',
          dataIndex: 'totalDebit'
        },
        {
          title: '贷方本币',
          align: 'right',
          key: 'totalCredi',
          dataIndex: 'totalCredi'
        }
      ]
    },
    {
      title: '操作',
      align: 'center',
      dataIndex: 'action',
      fixed: 'right',
      width: 120,
      scopedSlots: { customRender: 'action' }
    }
  ]
  return cols
}

export default columns
